package hl.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

import hl.pageModel.Charts;
import hl.pageModel.DataGrid;
import hl.pageModel.Json;
import hl.pageModel.Signing;
import hl.service.SigningService;

@Namespace("/")
@Action(value="signingAction")
public class SigningAction extends BaseAction implements ModelDriven<Signing>{

	Signing signing = new Signing();
	
	private SigningService signingService; 
	
	@Override
	public Signing getModel() {
		return signing;
	}

	public SigningService getSigningservice() {
		return signingService;
	}
	
	@Autowired
	public void setSigningservice(SigningService signingService) {
		this.signingService = signingService;
	}
	
	public void getDatagrid() {
		DataGrid d= signingService.getDatagrid(signing);
		super.writeJson(d);
	}
	
	public void getCharts() {
		Charts c = signingService.getCharts();
		super.writeJson(c);
	}
}
